<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>患者退血退费</title>
    <link rel="shortcut icon" type="image/x-icon" href="../../../../img/favicon.ico">
    <link rel="stylesheet" href="../../../../element-theme/blue/index.css">
    <style type="text/css">
        .tableLimit tr td .cell {
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-line-clamp: 1; /*可以显示的行数，超出部分用...表示 */
            -webkit-box-orient: vertical;
        }

        .el-form-item {
            margin: 20px 20px 0 0;
        }
    </style>
</head>
<body>

<div class="data-manage-table">
    <template>

        <el-form ref="form" :inline="true" style="padding:5px 20px 20px 20px;">
            <el-form-item label="患者退血单号">
                <el-input placeholder="请输入患者退血单号" v-model="pagination.backInformationNumber"></el-input>
            </el-form-item>
            <el-form-item label="患者ID">
                <el-input placeholder="请输入患者ID" v-model="pagination.patientId"></el-input>
            </el-form-item>
            <el-form-item label="输血单号">
                <el-input placeholder="请输入输血单号" v-model="pagination.transfusionNumber"></el-input>
            </el-form-item>
            <el-form-item label="病历号">
                <el-input placeholder="请输入病历号" v-model="pagination.pMedicalRecordNumber"></el-input>
            </el-form-item>
            <el-form-item label="血样编号">
                <el-input placeholder="请输入血样编号" v-model="pagination.pBloodSampleNumber"></el-input>
            </el-form-item>
            <el-form-item label="配血单编号">
                <el-input placeholder="请输入配血单编号" v-model="pagination.pBloodDispenseNumber"></el-input>
            </el-form-item>
            <el-form-item label="用血时间">
                <el-date-picker v-model="pagination.pUsageTime" placeholder="请选择用血时间" size="small"
                                format="yyyy-MM-dd"></el-date-picker>
            </el-form-item>
            <el-form-item label="是否允许退血">
                <el-input placeholder="请输入是否允许退血" v-model="pagination.pIsAllowedBack"></el-input>
            </el-form-item>
            <el-form-item label="输血后评价编号">
                <el-input placeholder="请输入输血后评价编号" v-model="pagination.pEvaluationNumber"></el-input>
            </el-form-item>
            <el-form-item label="不良反应编号">
                <el-input placeholder="请输入不良反应编号" v-model="pagination.pAdverseReactionNumber"></el-input>
            </el-form-item>
            <el-form-item label="退血驳回原因">
                <el-select v-model="pagination.pRejectInformation" placeholder="请选择退血驳回原因" clearable filterable
                           @blur="selectBlur" @clear="selectClearBBRR" @change="selectChangeBBRR">
                    <el-option v-for="(item,index) in options" :key="item.code" :label="item.reason"
                               :value="item.code"></el-option>
                </el-select>
            </el-form-item>
            <el-form-item>
                <el-button type="primary" @click="getData">搜索</el-button>
            </el-form-item>
            <el-form-item>
                <el-button type="info" @click="reset">清空</el-button>
            </el-form-item>
            <el-form-item>
                <el-button type="danger" @click="batchDownload()">批量下载</el-button>
            </el-form-item>
            <el-form-item>
                <el-button type="danger">批量删除</el-button>
            </el-form-item>
        </el-form>

        <el-table ref="selectTable" :data="dataList" style="width: 100%" border
                  :header-cell-style="{'text-align': 'center','background': '#eef1f6'}" highlight-current-row
                  class="tableLimit" @row-click="handle" :cell-style="{'text-align':'center'}">
            <el-table-column type="selection"></el-table-column>
            <el-table-column fixed="left" prop="id" label="ID">
                <template slot-scope="scope">
                    <el-button type="text" @click="showData">{{scope.row.id}}</el-button>
                </template>
            </el-table-column>
            <el-table-column prop="patientId" label="患者ID"></el-table-column>
            <el-table-column prop="backInformationNumber" label="退血单号"></el-table-column>
            <el-table-column prop="medicalRecordNumber" label="病历号"></el-table-column>
            <el-table-column prop="transfusionNumber" label="输血单号"></el-table-column>
            <el-table-column prop="bloodSampleNumber" label="血样编号"></el-table-column>
            <el-table-column prop="bloodDispenseNumber" label="配血单编号"></el-table-column>
            <el-table-column prop="usageTime" label="用血时间"></el-table-column>
            <el-table-column prop="isAllowedBack" label="是否允许退血">
                <template slot-scope="scope">
                    {{getIsBackBloodName(scope.row.isAllowedBack)}}
                </template>
            </el-table-column>
            <el-table-column prop="state" label="状态">
                <template slot-scope="scope">
                    {{getStateName(scope.row.state)}}
                </template>
            </el-table-column>
            <el-table-column prop="evaluationNumber" label="输血后评价编号"></el-table-column>
            <el-table-column prop="adverseReactionNumber" label="不良反应编号"></el-table-column>
            <el-table-column prop="rejectInformation" label="退血驳回原因">
                <template slot-scope="scope">
                    {{getBackRejectReasonName(scope.row.rejectInformation)}}
                </template>
            </el-table-column>
            <el-table-column fixed="right" label="操作" align="center">
                <template slot-scope="scope">
                    <el-button size="mini" type="danger" @click="backBloodMoney">退血退费</el-button>
                </template>
            </el-table-column>
        </el-table>

        <!--分页组件-->
        <div class="pagination-container">
            <el-pagination
                    class="pagination"
                    @size-change="handleSizeChange"
                    @current-change="handleCurrentChange"
                    :current-page="pagination.currentPage"
                    :page-sizes="[2,4,6,8,10]"
                    :page-size="pagination.pageSize"
                    layout="total, sizes, prev, pager, next, jumper"
                    :total="pagination.total"
                    style="text-align: center; margin-top: 20px;">
            </el-pagination>
        </div>

        <el-dialog title="患者退血退费信息" center :visible.sync="sData" width="90%" :close-on-click-modal="false">
            <template>
                <el-descriptions class="margin-top" :column="3" :size="size" border>
                    <el-descriptions-item>
                        <template slot="label">
                            <i class="el-icon-user"></i>
                            患者ID
                        </template>
                        {{shData.sPatientId}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            <i class="el-icon-user"></i>
                            退血单号
                        </template>
                        {{shData.sBackInformationNumber}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            <i class="el-icon-user"></i>
                            创建时间
                        </template>
                        {{shData.sGmtCreate}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            <i class="el-icon-user"></i>
                            修改时间
                        </template>
                        {{shData.sGmtModified}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            <i class="el-icon-user"></i>
                            病历号
                        </template>
                        {{shData.sMedicalRecordNumber}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            <i class="el-icon-user"></i>
                            输血单号
                        </template>
                        {{shData.sTransfusionNumber}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            <i class="el-icon-user"></i>
                            血样编号
                        </template>
                        {{shData.sBloodSampleNumber}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            <i class="el-icon-user"></i>
                            配血单编号
                        </template>
                        {{shData.sBloodDispenseNumber}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            <i class="el-icon-user"></i>
                            用血时间
                        </template>
                        {{shData.sUsageTime}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            <i class="el-icon-user"></i>
                            是否允许退血
                        </template>
                        {{getIsBackBloodName(shData.sIsAllowBack)}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            <i class="el-icon-user"></i>
                            状态
                        </template>
                        {{getStateName(shData.sState)}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            <i class="el-icon-user"></i>
                            输血后评价编号
                        </template>
                        {{shData.sEvaluationNumber}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            <i class="el-icon-user"></i>
                            不良反应编号
                        </template>
                        {{shData.sAdverseReactionNumber}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            <i class="el-icon-user"></i>
                            退血驳回原因
                        </template>
                        {{getBackRejectReasonName(shData.sRejectInformation)}}
                    </el-descriptions-item>
                </el-descriptions>
            </template>
        </el-dialog>

        <el-dialog title="患者退血退费" center :visible.sync="setData" width="98%" :close-on-click-modal="false">
            <template>
                <el-form :model="ruleForm" ref="ruleForm" label-position="right" :rules="rules">
                    <template>
                        <el-descriptions class="margin-top" :column="3" :size="size" border>
                            <el-descriptions-item>
                                <template slot="label">
                                    <i class="el-icon-user"></i>
                                    患者ID
                                </template>
                                {{backPatientID}}
                            </el-descriptions-item>
                            <el-descriptions-item>
                                <template slot="label">
                                    <i class="el-icon-document"></i>
                                    输血单号
                                </template>
                                {{backTransfusionNumber}}
                            </el-descriptions-item>
                            <el-descriptions-item>
                                <template slot="label">
                                    <i class="el-icon-s-order"></i>
                                    退血单号
                                </template>
                                {{backNumber}}
                            </el-descriptions-item>
                            <el-descriptions-item>
                                <template slot="label">
                                    <i class="el-icon-s-order"></i>
                                    审核人姓名
                                </template>
                                <el-form-item label="" prop="selectName1">
                                    <el-select v-model="ruleForm.selectName1" placeholder="请选择审核人姓名"
                                               @change="appAppName">
                                        <el-option
                                                v-for="item in nameList1"
                                                :key="item.code"
                                                :label="item.name"
                                                :value="item.code"
                                                :disabled="item.disabled"
                                        />
                                    </el-select>
                                </el-form-item>
                            </el-descriptions-item>
                            <el-descriptions-item>
                                <template slot="label">
                                    <i class="el-icon-s-order"></i>
                                    审核人工号
                                </template>
                                <el-input disabled placeholder="请输入审核人工号" v-model="backAuditorNumber"></el-input>
                            </el-descriptions-item>
                            <el-descriptions-item>
                                <template slot="label">
                                    <i class="el-icon-s-order"></i>
                                    审核时间
                                </template>
                                <el-form-item label="" prop="backAuditTime">
                                    <el-date-picker
                                            v-model="ruleForm.backAuditTime"
                                            type="date"
                                            placeholder="选择日期"
                                            size="small"
                                            format="yyyy-MM-dd HH:mm:ss">
                                    </el-date-picker>
                                </el-form-item>
                            </el-descriptions-item>
                            <el-descriptions-item>
                                <template slot="label">
                                    <i class="el-icon-s-order"></i>
                                    退款金额
                                </template>
                                <el-input placeholder="请输入退款金额" v-model="ruleForm.backRefundAmount"></el-input>
                            </el-descriptions-item>
                            <el-descriptions-item>
                                <template slot="label">
                                    <i class="el-icon-s-order"></i>
                                    退款操作人姓名
                                </template>
                                <el-form-item label="" prop="selectName2">
                                    <el-select v-model="ruleForm.selectName2" placeholder="请选择退款操作人姓名"
                                               @change="backOpName">
                                        <el-option
                                                v-for="item in nameList2"
                                                :key="item.code"
                                                :label="item.name"
                                                :value="item.code"
                                                :disabled="item.disabled"
                                        />
                                    </el-select>
                                </el-form-item>
                            </el-descriptions-item>
                            <el-descriptions-item>
                                <template slot="label">
                                    <i class="el-icon-s-order"></i>
                                    退款操作人工号
                                </template>
                                <el-input disabled placeholder="请输入审核人工号" v-model="backRefundOperatorNumber"></el-input>
                            </el-descriptions-item>
                            <el-descriptions-item>
                                <template slot="label">
                                    <i class="el-icon-s-order"></i>
                                    退款完成时间
                                </template>
                                <el-form-item label="" prop="backRefundFinishTime">
                                    <el-date-picker
                                            v-model="ruleForm.backRefundFinishTime"
                                            type="date"
                                            placeholder="选择日期"
                                            size="small"
                                            format="yyyy-MM-dd HH:mm:ss">
                                    </el-date-picker>
                                </el-form-item>
                            </el-descriptions-item>
                            <el-descriptions-item>
                                <template slot="label">
                                    <i class="el-icon-s-order"></i>
                                    收款人姓名
                                </template>
                                <el-form-item label="" prop="selectName3">
                                    <el-select v-model="ruleForm.selectName3" placeholder="请选择收款人姓名"
                                               @change="getMoneyName">
                                        <el-option
                                                v-for="item in nameList3"
                                                :key="item.code"
                                                :label="item.name"
                                                :value="item.code"
                                                :disabled="item.disabled"
                                        />
                                    </el-select>
                                </el-form-item>
                            </el-descriptions-item>
                            <el-descriptions-item>
                                <template slot="label">
                                    <i class="el-icon-s-order"></i>
                                    收款人身份证号
                                </template>
                                <el-input disabled placeholder="请输入收款人身份证号" v-model="backPayeeIdcard"></el-input>
                            </el-descriptions-item>
                        </el-descriptions>
                    </template>
                </el-form>
                <div slot="footer" class="dialog-footer" align="center">
                    <el-button @click="cancel()">重 置</el-button>
                    <el-button type="primary" @click="save()">提交</el-button>
                </div>
            </template>
        </el-dialog>

    </template>
</div>

<script src="../../../../plugins/vue-2.6.11/vue.js"></script>
<script src="../../../../plugins/axios-0.27.2/axios.min.js"></script>
<script src="../../../../icons/iconfont.js"></script>
<script src="/js/2.15.12/index.js"></script>
<link href="/css/2.15.12/index.min.css" rel="stylesheet">
<script src="/js/httpVueLoader.js"></script>
<script src="/js/jquery.min.js"></script>
<script>Vue.prototype.$ELEMENT = {size: 'medium'};</script>
<script>(
    function () {
        new Vue({
            el: '.data-manage-table',
            data() {
                return {
                    // 表单校验
                    ruleForm: {
                        selectName1: '',
                        backAuditTime: undefined,
                        backRefundAmount: undefined,
                        selectName2: '',
                        selectName3: '',
                        backRefundFinishTime: undefined,
                    },
                    rules: {
                        selectName1: [
                            {required: true, message: '请选择审核人姓名', trigger: 'change'}
                        ],
                        backAuditTime: [
                            {type: 'date', required: true, message: '请选择日期', trigger: 'change'}
                        ],
                        backRefundAmount: [
                            {required: true, message: '请输入退款金额', trigger: 'blur'},
                        ],
                        selectName2: [
                            {required: true, message: '请选择退款操作人姓名', trigger: 'change'}
                        ],
                        selectName3: [
                            {required: true, message: '请选择收款人姓名', trigger: 'change'}
                        ],
                        backRefundFinishTime: [
                            {type: 'date', required: true, message: '请选择日期', trigger: 'change'}
                        ],
                    },
                    //表格信息
                    tableData: [],
                    setData: false,
                    backPatientID: undefined,
                    backTransfusionNumber: undefined,
                    backNumber: undefined,
                    backAuditor: undefined,
                    backAuditorNumber: undefined,
                    backRefundOperator: undefined,
                    backRefundOperatorNumber: undefined,
                    backPayeeName: undefined,
                    backPayeeIdcard: undefined,
                    nameList1: [
                        {
                            code: '01',
                            name: '张三'
                        },
                        {
                            code: '02',
                            name: '李四'
                        },
                        {
                            code: '03',
                            name: '王五'
                        },
                        {
                            code: '04',
                            name: '赵六'
                        },
                        {
                            code: '05',
                            name: '钱七'
                        },
                        {
                            code: '06',
                            name: '孙八'
                        },
                        {
                            code: '07',
                            name: '周九'
                        },
                        {
                            code: '08',
                            name: '吴十'
                        },
                    ],
                    nameList2: [
                        {
                            code: '01',
                            name: '张三'
                        },
                        {
                            code: '02',
                            name: '李四'
                        },
                        {
                            code: '03',
                            name: '王五'
                        },
                        {
                            code: '04',
                            name: '赵六'
                        },
                        {
                            code: '05',
                            name: '钱七'
                        },
                        {
                            code: '06',
                            name: '孙八'
                        },
                        {
                            code: '07',
                            name: '周九'
                        },
                        {
                            code: '08',
                            name: '吴十'
                        },
                    ],
                    nameList3: [
                        {
                            code: '211322111111111111',
                            name: '张三'
                        },
                        {
                            code: '211322222222222222',
                            name: '李四'
                        },
                        {
                            code: '211322333333333333',
                            name: '王五'
                        },
                        {
                            code: '211322444444444444',
                            name: '赵六'
                        },
                        {
                            code: '211322555555555555',
                            name: '钱七'
                        },
                        {
                            code: '211322666666666666',
                            name: '孙八'
                        },
                        {
                            code: '211322777777777777',
                            name: '周九'
                        },
                        {
                            code: '211322888888888888',
                            name: '吴十'
                        },
                    ],
                    size: '',
                    user: {
                        "accountNonExpired": true,
                        "accountNonLocked": true,
                        "credentialsNonExpired": true,
                        "enable": false,
                        "enabled": false,
                        "jobnum": "",
                        "menuUrls": {
                            "menu": [{
                                "urls": [{
                                    "id": "11",
                                    "title": "11",
                                    "url": "/pages/error/403.html",
                                    "titleflag": "error"
                                }], "title": "testerror", "titleflag": "error"
                            }, {
                                "urls": [{
                                    "id": "22",
                                    "title": "5-5",
                                    "url": "/pages/error/505.html",
                                    "titleflag": "testerror"
                                }], "title": "testerror2", "titleflag": "testerror"
                            }]
                        },
                        "noLocked": false,
                        "personalization": {
                            "asideFold": false,
                            "mainTabsHeaderFixed": true,
                            "asideControlOpen": false,
                            "headerSkin": "colorful",
                            "headerFixed": false,
                            "skin": "brown",
                            "asideSkin": "dark",
                            "asideControlFixed": true
                        },
                        "username": ""
                    },
                    pagination: {//分页相关模型数据
                        currentPage: 1,//当前页码
                        pageSize: 4,//每页显示的记录数
                        total: 0,//总记录数
                        //需要根据查询的条件
                        backInformationNumber: "",
                        patientId: "",
                        transfusionNumber: "",
                        pMedicalRecordNumber: "",
                        pBloodSampleNumber: "",
                        pBloodDispenseNumber: "",
                        pUsageTime: "",
                        pIsAllowedBack: "",
                        pState: "",
                        pEvaluationNumber: "",
                        pAdverseReactionNumber: "",
                        pRejectInformation: "",
                    },
                    dataList: [],
                    isBackBloodList: [],
                    stateList: [],
                    backRejectReasonList: [],
                    shData: {
                        sPatientId: "",
                        sBackInformationNumber: "",
                        sGmtCreate: "",
                        sGmtModified: "",
                        sMedicalRecordNumber: "",
                        sTransfusionNumber: "",
                        sBloodSampleNumber: "",
                        sBloodDispenseNumber: "",
                        sUsageTime: "",
                        sIsAllowBack: "",
                        sState: "",
                        sEvaluationNumber: "",
                        sAdverseReactionNumber: "",
                        sRejectInformation: "",
                    },
                    sData: false,
                    options: [
                        {
                            code: '01',
                            reason: '已用',
                        },
                        {
                            code: '02',
                            reason: '包装损坏',
                        },
                        {
                            code: '03',
                            reason: '血标本凝固'
                        },
                        {
                            code: '04',
                            reason: '血标本量不准'
                        },
                        {
                            code: '05',
                            reason: '血标本溶血',
                        },
                    ],
                }
            },
            //自动触发写入的函数
            created() {
                this.getData();
            },
            mounted() {
                this.user = sessionStorage.getItem("user") ? JSON.parse(sessionStorage.getItem("user")) : {};
                this.getIsBackBlood();
                this.getState();
                this.getBackRejectReason();
            },
            methods: {
                getData() {
                    const url = "/bloodcanclepatient/normal/getpass/" + this.pagination.currentPage + '/' + this.pagination.pageSize;
                    axios.get(
                        url,
                        {
                            params: {
                                state: "18",
                                patientId: this.pagination.patientId,
                                transfusionNumber: this.pagination.transfusionNumber,
                                backInformationNumber: this.pagination.backInformationNumber,
                                medicalRecordNumber: this.pagination.pMedicalRecordNumber,
                                bloodSampleNumber: this.pagination.pBloodSampleNumber,
                                bloodDispenseNumber: this.pagination.pBloodDispenseNumber,
                                usageTime: this.pagination.pUsageTime,
                                isAllowedBack: this.pagination.pIsAllowedBack,
                                evaluationNumber: this.pagination.pEvaluationNumber,
                                adverseReactionNumber: this.pagination.pAdverseReactionNumber,
                                rejectInformation: this.pagination.pRejectInformation,
                            }
                        }
                    ).then(res => {
                            if (res.data.code === "200") {
                                console.log(res.data);
                                this.pagination.pageSize = res.data.data.size;
                                this.pagination.currentPage = res.data.data.current;
                                this.pagination.total = res.data.data.total;
                                this.dataList = res.data.data.records;
                            } else {
                                this.$message.error(res.data.msg);
                            }
                        }
                    )
                },
                // 批量下载
                batchDownload() {
                    if (JSON.parse(JSON.stringify(this.$refs.selectTable.selection)).length == 0) {
                        this.$notify({
                            title: '温馨提示：',
                            message: '您未选中数据，请重新操作！！！',
                            type: 'warning'
                        });
                        return;
                    }
                    let checkArr = JSON.parse(JSON.stringify(this.$refs.selectTable.selection));  // 存储了勾选到的数据
                    var ids = new Array()
                    for (var i = 0; i < checkArr.length; i++) {
                        ids[i] = checkArr[i].id;
                    }
                    // 批量下载
                    this.$confirm('确定下载这些数据吗, 是否继续?', '批量打印', {
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                        type: 'warning'
                    }).then(() => {
                        const a = document.createElement('a')
                        a.href = '/bloodcanclepatient/normal/batchdownloadbpm?' + 'ids=' + ids
                        a.click()
                    });
                },
                selectBlur(e) {
                    if (e.target.value !== '') {
                        this.pagination.pRejectInformation = e.target.value;
                        this.$forceUpdate() //强制更新
                    }
                },
                // 清空退血原因
                selectClearBBRR() {
                    this.pagination.pRejectInformation = '';
                    this.$forceUpdate();
                },
                // 输入退血原因
                selectChangeBBRR(val) {
                    this.pagination.pRejectInformation = val;
                    this.$forceUpdate();
                },
                // 获取是否允许退血字典
                getIsBackBlood() {
                    axios.get('/isbackblood/normal/query')
                        .then((res) => {
                            if (res.data.code === '200') {
                                this.isBackBloodList = res.data.data
                            } else {
                                this.$notify.error({
                                    title: '错误',
                                    message: '获取数据失败'
                                })
                            }
                        })
                },
                // 将表格中的IsBackBlood字段的code转换成name
                getIsBackBloodName(code) {
                    for (let i = 0; i < this.isBackBloodList.length; i++) {
                        if (this.isBackBloodList[i].code == code) {
                            return this.isBackBloodList[i].name;
                        }
                    }
                },
                // 获取状态字典
                getState() {
                    axios.get('/state/normal/getName')
                        .then((res) => {
                            if (res.data.code === '200') {
                                this.stateList = res.data.data
                            } else {
                                this.$notify.error({
                                    title: '错误',
                                    message: '获取数据失败'
                                })
                            }
                        })
                },
                // 将表格中的State字段的code转换成name
                getStateName(code) {
                    for (let i = 0; i < this.stateList.length; i++) {
                        if (this.stateList[i].code === code) {
                            return this.stateList[i].state;
                        }
                    }
                },
                // 获取退血驳回原因字典
                getBackRejectReason() {
                    axios.get('/backrejectreason/normal/query')
                        .then((res) => {
                            if (res.data.code === '200') {
                                this.backRejectReasonList = res.data.data
                            } else {
                                this.$notify.error({
                                    title: '错误',
                                    message: '获取数据失败'
                                })
                            }
                        })
                },
                // 将表格中的BackRejectBlood字段的code转换成reason
                getBackRejectReasonName(code) {
                    for (let i = 0; i < this.backRejectReasonList.length; i++) {
                        if (this.backRejectReasonList[i].code === code) {
                            return this.backRejectReasonList[i].reason;
                        }
                    }
                },
                // 分页查询 每页显示多少条数据
                handleSizeChange: function (pageSize) {
                    this.pagination.pageSize = pageSize;
                    this.getData()
                },

                //分页查询 切换页码
                handleCurrentChange: function (currentPage) {
                    this.pagination.currentPage = currentPage;
                    //执行查询
                    this.getData()
                },
                reset() {
                    this.pagination.backInformationNumber = "";
                    this.pagination.patientId = "";
                    this.pagination.transfusionNumber = "";
                    this.pMedicalRecordNumber = "";
                    this.pBloodSampleNumber = "";
                    this.pBloodDispenseNumber = "";
                    this.pUsageTime = "";
                    this.pIsAllowedBack = "";
                    this.pEvaluationNumber = "";
                    this.pAdverseReactionNumber = "";
                    this.pRejectInformation = "";
                    this.dataList = undefined;
                    this.getData()
                },
                appAppName(val) {
                    let obj = {};//定义对象集合
                    obj = this.nameList1.find(item => {
                        return item.code === val; //筛选出匹配数据 返回对象
                    });
                    this.backAuditor = obj.name;
                    this.backAuditorNumber = obj.code;
                },
                backOpName(val) {
                    let obj = {};//定义对象集合
                    obj = this.nameList2.find(item => {
                        return item.code === val; //筛选出匹配数据 返回对象
                    });
                    this.backRefundOperator = obj.name;
                    this.backRefundOperatorNumber = obj.code;
                }
                ,
                getMoneyName(val) {
                    let obj = {};//定义对象集合
                    obj = this.nameList3.find(item => {
                        return item.code === val; //筛选出匹配数据 返回对象
                    });
                    this.backPayeeName = obj.name;
                    this.backPayeeIdcard = obj.code;
                    console.log(this.backPayeeName)
                }
                ,
                handle(row) {
                    console.log(row);
                    this.backPatientID = row["patientId"];
                    this.backTransfusionNumber = row["transfusionNumber"];
                    this.backNumber = row["backInformationNumber"];
                    this.shData.sPatientId = row["patientId"];
                    this.shData.sBackInformationNumber = row["backInformationNumber"];
                    this.shData.sGmtCreate = row["gmtCreate"];
                    this.shData.sGmtModified = row["gmtModified"];
                    this.shData.sMedicalRecordNumber = row["medicalRecordNumber"];
                    this.shData.sTransfusionNumber = row["transfusionNumber"];
                    this.shData.sBloodSampleNumber = row["bloodSampleNumber"];
                    this.shData.sBloodDispenseNumber = row["bloodDispenseNumber"];
                    this.shData.sUsageTime = row["usageTime"];
                    this.shData.sIsAllowBack = row["isAllowedBack"];
                    this.shData.sState = row["state"];
                    this.shData.sEvaluationNumber = row["evaluationNumber"];
                    this.shData.sAdverseReactionNumber = row["adverseReactionNumber"];
                    this.shData.sRejectInformation = row["rejectInformation"];
                },
                backBloodMoney() {
                    this.setData = true;
                },
                save() {
                    this.$refs.ruleForm.validate((valid) => {
                        if (valid) {
                            const params = {};
                            params.transfusionNumber = this.backTransfusionNumber;
                            params.backInformationNumber = this.backNumber;
                            params.patientID = this.backPatientID;
                            params.auditor = this.backAuditor;
                            params.auditorNumber = this.backAuditorNumber;
                            params.auditTime = this.ruleForm.backAuditTime;
                            params.refundOperator = this.backRefundOperator;
                            params.refundAmount = this.ruleForm.backRefundAmount;
                            params.refundOperatorNumber = this.backRefundOperatorNumber;
                            params.refundFinishTime = this.ruleForm.backRefundFinishTime;
                            params.payeeName = this.backPayeeName;
                            params.payeeIdcard = this.backPayeeIdcard;
                            axios({
                                method: "post",
                                url: "/bloodcanclepatient/normal/moneycancle",
                                data: params,
                                headers: {
                                    'Content-Type': 'application/json;charset=UTF-8'
                                }
                            }).then(res => {
                                console.log(res.data);
                                if (res.data.code === "200") {
                                    this.getData();
                                    this.setData = false;
                                    this.$message.success("退血退费成功");
                                } else {
                                    this.$message.error(res.data.msg);
                                }
                            });
                        } else {
                            console.log('提交有误！');
                            return false;
                        }
                    })
                },
                //重置按钮
                cancel() {
                    this.$refs.ruleForm.resetFields();
                },
                showData() {
                    this.sData = true;
                },
            },
        })
        ;
    })
()
</script>
<style>
    .el-form-item {
        margin-bottom: 0px;
    }
</style>
</body>
</html>